from pydantic import BaseModel


class Resource(BaseModel):
    cpu: int
    mem: int
    gpu: list[dict] | None = None


class Utilization(BaseModel):
    util: float
    used: int
    total: int


class Status(BaseModel):
    cpu: Utilization
    mem: Utilization
    gpu: Utilization | None = None


class ClusterInfo(BaseModel):
    name: str
    cluster_id: str
    host: str
    dashboard_port: int
    resource: Resource
    status: dict


class ClusterInDB(BaseModel):
    id: str | None = None
    name: str
    uuid: str
    cluster_info: str
